package com.icinfo.cloud.provider.punish.common.seal.utils;

import cn.hutool.json.JSONArray;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * 查询用户信息入参
 *
 * @author yunchao.peng
 * @create 2023-08-09 22:31
 */
@Data
@AllArgsConstructor
public class SearchInfoParam {
    /**
     * 页码 1
     */
    private Integer pageNo;
    /**
     * 大小 2
     */
    private Integer pageSize;

    public SearchInfoParam(List<SearchInfoKeyValue> search) {
        this.search = search;
    }

    /**
     * 使用办法 [{"ENTNAME.eq":"沙坪坝区柊柠百货经营部"},{"UNISCID.eq":"92500106MA60WW202T"}]
     */
    private List<SearchInfoKeyValue> search;

    public static String toParam(List<SearchInfoKeyValue> param) {
        JSONArray data = new JSONArray();
        for (SearchInfoKeyValue searchInfoKeyValue : param) {
            data.add(searchInfoKeyValue.cover());
        }
        return data.toString();
    }
}
